const api = require('../utils/request.js')
import {request} from '../utils/request'

module.exports = {

// 查询营地交流信息
campCommonicationList(data) {
    return api.request({
      url: `/wechat/commonication/list`,
      method: 'get',
      data
    })
  },

     // 营地交流信息修改
    campCommonicationUpdata(data) {
    return api.request({
      url: `/wechat/commonication`,
      method: 'put',
      data
    })
  },

     // 营地交流信息添加
   campCommonicationAdd(data) {
    return api.request({
      url: `/wechat/commonication`,
      method: 'post',
      data
    })
  },






   // 查询所有订单
   goodsOrderList(data) {
    return api.request({
      url: `/wechat/order/list`,
      method: 'get',
      data
    })
  },

     // 商品订单修改
   goodsOrderUpdata(data) {
    return api.request({
      url: `/wechat/order`,
      method: 'put',
      data
    })
  },

     // 商品订单添加
   goodsOrderAdd(data) {
    return api.request({
      url: `/wechat/order`,
      method: 'post',
      data
    })
  },

    // 商品添加
   campGoodsAdd(data) {
    return api.request({
      url: `/wechat/goods/add`,
      method: 'post',
      data
    })
  },
  // 商品删除
  campDelGoods(goodsId) {
    return api.request({
      url: '/wechat/goods/delete/' + goodsId,
      method: 'delete'
    })
  },

  // 获取对应的营地商品信息
    getGoodsByCampId(id) {
        return api.request({
          url: '/wechat/goods/getGoodsByCampId/'+id,
          method: 'get',
        })
      },

  // 获取根据用户id获取对应的营地预约信息
  getAppointmentByUserId(data) {
    return api.request({
      url: '/wechat/appointment/list',
      method: 'get',
      data
    })
  },


  // 获取营地列表
  campList(data) {
    return api.request({
      url: '/wechat/camp/list',
      method: 'get',
      data
    })
  },
  //营地信息修改
  campUpInfo(params) {
    return api.request({
      url: '/wechat/camp',
      method: 'put',
      data: {
        "campId": "2e72e788-fc9b-4065-9820-0347116e7a7f",
        "address": params.address,
        "campName": params.campName,
        "campType": params.campType,
        "imageUrl": params.imageUrl.join(","),
        "introduce": params.introduce,
        "latitude": params.latitude,
        "location": params.location,
        "longitude": params.longitude,
        "linkman": params.linkman,
        "phone": params.phone,
        "specificTime": params.timeType,
        "userId": params.userId,
        "userType": params.userType
      }
    })
  },
  //营地营位添加
  campAddCampsite(data) {
    return api.request({
      url: '/wechat/campsite',
      method: 'post',
      data
    })
  },
  //营地营位删除
  campDelCampsite(campsiteId) {
    return api.request({
      url: '/wechat/campsite/' + campsiteId,
      method: 'delete'
    })
  },
  //营地营位根据id获取 /wechat/campsite/list
  getCampCampsite(data) {
    return api.request({
      url: '/wechat/campsite/list',
      method: 'GET',
      data
    })
  },

  // 景点添加
  addScenic(data) {
    return api.request({
      url: `/wechat/spots/add`,
      method: 'post',
      data
    })
  },
  // 景点删除
  campDelScenic(scenicId) {
    return api.request({
      url: '/wechat/spots/delete/' + scenicId,
      method: 'delete'
    })
  },
  // 活动添加
  addActivity(data) {
    return api.request({
      url: `/wechat/activity/add`,
      method: 'post',
      data
    })
  },
  // 项目删除
  campDelActivity(activityId) {
    return api.request({
      url: '/wechat/activity/delete/' + activityId,
      method: 'delete'
    })
  },
  // 项目添加
  addOtherProject(data) {
    return api.request({
      url: `/wechat/project/add`,
      method: 'post',
      data
    })
  },
  // 项目删除
  campDelProject(projectId) {
    return api.request({
      url: '/wechat/project/delete/' + projectId,
      method: 'delete'
    })
  },
  // 删除营地
  deleteCamp(campId) {
    return api.request({
      url: `/wechat/camp/${campId}`,
      method: 'delete'
    })
  },
  // 获取营位列表
  getCampsiteList(query) {
    return api.request(
      "/wechat/campsite/list",
      "get",
      query
    )
  },
  // 获取营地详细信息
  detailCamp(id) {
    return api.request({
      url: `/wechat/camp/${id}`
    })
  },
  
  // 查询该营地的服务设施列表
  seekList(id){
    return api.request({
      url: `/wechat/facility/getInfo/${id}`
    })
  },
  // 修改营地
  modifyCamp(data) {
    return api.request({
      url: "/wechat/camp",
      method: "POST",
      data
    })
  }
}